<?php echo $header;echo $sidebar ?>		

	<style>
		select {background-color: #FFFFFF;border: 1px solid #CCCCCC;width: 100% !important;}
		.clear{clear: both;}
	</style>
	
	<div class="span10 content">

		<?php echo $hugemenu ?>

		<h1>Create New Department</h1>

		<?php if($this->session->flashdata('message')) :?>
			<div class="alert alert-success">
				<?php echo $this->session->flashdata('message') ?>
			</div>
		<?php endif; ?>
		
		<?php if($message) { echo "<div class=\"alert alert-danger\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>" . $message . "</div>"; } ?>

	

		<div class="row" style="padding:15px;">
			<div class="span6">
				<?php 
		        $error = $this->session->flashdata('error');
		            	
		        if($error)
		        {
		        	echo "<div class='alert alert-danger'>{$error}</div>";
		        } ?>
		        
		        <form id="create-department-form" action="<?php echo base_url(); ?>index.php/departments/insert" method="post">
		        	<div class="form-group" style="margin-bottom:15px;">
						<label>Name</label>
						<input name="name" type="text" class="form-control" style="width:98%;" autocomplete="off">
					</div>
					
					<div class="form-group" style="margin-bottom:15px;">
						<label>Assigned Users</label>
						<select name="assigned[]" class="form-control" style="width:98%;" multiple>
							<?php
							for($i = 0; $i < count($company_users); ++$i)
							{ ?>
								<option value="<?php echo $company_users[$i]['id']; ?>"><?php echo $company_users[$i]['first_name'].' '.$company_users[$i]['last_name']; ?></option>
							<?php 
							} ?>
						</select>
					</div>
					
					<div class="form-group" style="margin-bottom:15px;">
						<label>Assigned Projects</label>
						<select name="projects[]" class="form-control" style="width:98%;" multiple>
							<?php
							for($i = 0; $i < count($company_projects); ++$i)
							{ ?>
								<option value="<?php echo $company_projects[$i]['project_id']; ?>"><?php echo $company_projects[$i]['project_name']; ?></option>
							<?php
							} ?>
						</select>
					</div>
					
					<div class="form-group" style="margin-bottom:15px;">
						<label>Description</label>
						<textarea name="description" class="form-control" style="width:98%;" rows="8"><?php echo $this->session->flashdata('backfill_description'); ?></textarea>
					</div>
					
					<div class="form-group">
						<button type="submit" class="btn btn-primary pull-left">Create</button>
					</div>
		        </form>
		    </div>
		</div>
	</div><!--/content-->

<?php echo $footer ?>